package com.colorful.insuranceproject.base;

import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.view.ViewGroup;
import android.widget.TextView;

import com.colorful.insuranceproject.R;
import com.lovely3x.common.image.picker.ImagePickerListActivity;

/**
 * 图片选择器的列表界面
 * Created by lovely3x on 17/3/3.
 */
public class  YLSImagePickerListActivity extends ImagePickerListActivity {


    @Override
    protected void launchDetailsListActivity(Bundle extras) {
        launchActivityForResult(YLSImagePickerGridDetailActivity.class, IMAGE_PICKER_DETAIL_REQUEST_CODE, extras);
    }

    @Override
    protected void addTitleHeader(ViewGroup titleContainer) {
        super.addTitleHeader(titleContainer);
        getTitleContainer().setBackgroundColor(getColor(R.color.colorPrimary, true));
        getTvTitle().setTextColor(getColor(R.color.white, true));
        getIvBack().setImageResource(R.drawable.icon_back_white);
        Drawable draw = ContextCompat.getDrawable(mActivity,R.drawable.icon_back_white);
        draw.setBounds(0, 0, draw.getMinimumWidth(), draw.getMinimumHeight());
        getTvback().setCompoundDrawables(draw,null,null,null);
        getTvback().setTextColor(getColor(R.color.white, true));
    }


    public TextView addRightBtn(String text, int id) {
        TextView tv = super.addRightBtn(text, id);
        tv.setTextColor(Color.WHITE);
        return tv;
    }

    /**
     * 该方法主要作用是充值TintBar的颜色  让沉浸式得到显示
     * 如果该类不需要改方法  可以重写 applyTranslationStatusBarAndNavigationBar   去掉super方法即可
     */
    @Override
    public Tint getTint() {
        Tint tint = super.getTint();
        tint.mStatusBarColor = getResources().getColor(R.color.colorPrimary);
        return tint;
    }
}
